//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;
using OpenLS.Vml.Serialization;

namespace OpenLS.Vml.Word
{
    abstract class BorderBase: ShapeElement

    {
        private BorderType? _type;
        private int? _width;
        private bool? _shadow;

        internal abstract string Name{
            get;}
        

       

        internal override void ReadXmlCore(ReadContext context)
        {
            using (var c = context.Read(VmlConstants.WordNamespace + Name))
            {
                _type = c.GetOptionalEnum<BorderType>("type");
                _width = c.GetOptionalInteger("width");
                _shadow = c.GetOptionalBoolean("shadow");
            }
       
        }

        internal override void WriteXmlCore(WriteContext context)
        {
            using (var c = context.Write(VmlConstants.WordNamespace + Name))
            {
                c.SetOptionalEnum("type", _type);
                c.SetOptionalInteger("width", _width);
                c.SetOptionalBoolean("shadow", _shadow);
            }
        }
    }
}